package eureka.ui.account;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import util.lang.StringHelper;

/**
 * Servlet implementation class ChangePasswordMailSent
 */
@WebServlet("/Account/RestorePasswordMailSent")
public class RestorePasswordMailSent extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public RestorePasswordMailSent() {
        super();
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String emailMasked = request.getParameter("email");
		
		if (emailMasked != null && !"".equals(emailMasked)) {
			request.setAttribute("emailMasked", emailMasked);
			request.setAttribute("emailSite", StringHelper.extractEmailWebsite(emailMasked));
		}
		
		request.getRequestDispatcher("restorepwd_sendemail.jsp").forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
